#include "warehouse.hh"

warehouse::warehouse (unsigned id, int x, int y, unsigned c)
  : id_ (id),
    x_ (x),
    y_ (y),
    c_ (c)
{
}

double
warehouse::dist (const warehouse& other) const
{
  return (sqrt((x_ - other.x_) * (x_ - other.x_) + (y_ - other.y_) * (y_ - other.y_)));
}

unsigned
warehouse::get_c () const
{
  return c_;
}

std::ostream& operator << (std::ostream& stream, const warehouse& w)
{
  stream << "Warehouse number : " << w.id_ << std::endl
	 << "(x, y) = (" << w.x_ << ", " << w.y_ << ")" << std::endl
	 << "capacity = " << w.c_ << std::endl;

  return (stream);
}
